<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>

    <meta charset="utf-8">
    <title>用户注册</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript">

        var msg = "${errMsg}";
        // var name1 = document.getElementById("username");
        if(msg != null && msg != ""){
            alert(msg);
        }

        function verification(){
            //得到name输入框对象
            var name = document.getElementById("username");
            //判断输入框是否有内容
            if(name.value.length==0){
                confirm("用户名不能为空");
                return false;
            }
            var pass = document.getElementById("password");
            if(pass.value.length==0){
                confirm("密码不能为空");
                return false;
            }
            // alert("注册成功！返回登录界面！");
            return true;
        }

    </script>
    <style>
        #register{
            margin: auto;
            float: center;
            height: 50%;
            width: 23%;
            margin-top: 200px;
            /*display: inline;*/
            /*z-index: 999;*/
            border: 0;
        }
        #top{
            text-align: center;
            margin-bottom: 50px;
        }
        #corner{
            margin: 75px;
        }


    </style>

</head>
<body background="/page/image/bg2.jpg"  style="    background-size:100% 100%;">


<div class="panel panel-default" id="register" style="width: 400px;  background: rgba(255, 255, 255, 0.5);">
    <div class="panel-body">
        <div id="top">
            <h1><b>用户注册</b></h1>
        </div>
<%--        <b>测试账号:zhangsan  密码:123456<b/>--%>

        <form class="form-horizontal" action="/user/register" method="post" onsubmit="return verification()">
            <div class="form-group">
                <label for="username" style="text-indent: 11px;">用户名</label>
                <input type="text" class="form-control" name="username" id="username" placeholder="请输入用户名" value="" style="width: 380px; margin: auto;">
            </div>
            <div class="form-group">
                <label for="password" style="text-indent: 11px;">密码</label>
                <input type="password" class="form-control" name="password" id="password" placeholder="请输入密码" value="" style="width: 380px; margin: auto;">
            </div>
            <input type="submit" class="btn btn-primary  btn-block"
                   value="注册" style="width: 100px; margin:5px auto;"/>
        </form>
            <div style="margin-top: 40px">
                <span id="corner"><a href="/page/admin/login.jsp">管理员登录</a></span>
                <span><a href="/page/user/login.jsp">用户登录</a></span>
            </div>
    </div>
</div>

</body>
</html>
